﻿using Asp.Versioning;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace Himp.TaskScheduling.V1
{
    /// <summary>
    /// 流程实例
    /// </summary>
    [Area(TaskSchedulingRemoteServiceConsts.ModuleName)]
    [RemoteService(Name = TaskSchedulingRemoteServiceConsts.RemoteServiceName)]
    [Route("api/taskScheduling/workflowInstance")]
    [ApiVersion("1.0")]
    [ApiController]
    [ControllerName("workflowInstance")]
    public class WorkflowInstanceController : TaskSchedulingController, IWorkflowInstanceService
    {
        private IWorkflowInstanceService _workflowInstanceService;

        public WorkflowInstanceController(IWorkflowInstanceService workflowInstanceService)
        {
            _workflowInstanceService = workflowInstanceService;
        }

        [HttpGet]
        public async Task<PagedResultDto<WorkflowInstanceDto>> GetListAsync([FromQuery] WorkflowInstanceInput input)
        {
            return await _workflowInstanceService.GetListAsync(input);
        }

        [HttpPost]
        public async Task<WorkflowInstanceStasDto> PostAsync(WorkflowInstanceCreateDto input)
        {
            return await _workflowInstanceService.PostAsync(input);
        }

        [HttpPut]
        public async Task<WorkflowInstanceStasDto> PutAsync(WorkflowInstanceExecDto input)
        {
            return await _workflowInstanceService.PutAsync(input);
        }
    }
}
